package cn.tedu._01mvcboot01.controller;

import cn.tedu._01mvcboot01.pojo.dto.UserRegDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {

    @RequestMapping("/v1/user/login")
    @ResponseBody
    public String login(String username, String password){
        return "欢迎你:"+username+"   您的密码是:"+password;
    }
    @RequestMapping("/v1/user/reg")
    @ResponseBody
    public String reg(UserRegDTO userRegDTO){
        String username = userRegDTO.getUsername();
        String password = userRegDTO.getPassword();
        Integer age = userRegDTO.getAge();
        return "恭喜:"+username+"注册成功"+"您的密码是:"+password+"您的年龄是:"+age;
    }
}
